package com.zijin.exec;

import java.util.Scanner;

public class Text09 {
    public static void main(String[] args) {
        int total = 0;
        for(int i = 1;i<5;i++){
            System.out.println("欢迎光临第"+i+"家专卖店");
            Scanner input = new Scanner(System.in);
            for (int j = 0;j<3;j++) {
                while(true) {
                    System.out.println("要离开吗(y/n)");
                    String start = input.next();
                    if(start.equals("n")){
                        total += 1;
                        System.out.println("买了一件衣服");
                        break;
                    }else if(start.equals("y")){
                        System.out.println("离店结账");
                        j = 3;
                        break;
                    }
                }
            }
        }
        System.out.println("总共买了"+total+"件衣服");
    }
}
